<template>
    <div>
        <p style="font-weight: bold" class="interfaceHead"><i class="el-icon-s-promotion"></i>处罚查询</p>
        <el-divider></el-divider>
        <el-input style="width: 40%"
                  placeholder="请输入单位名称进行搜索..."
                  prefix-icon="el-icon-search"
                  v-model="findName">
        </el-input>
        <el-button style="margin-left: 20px" @click="getMessageList"  type="primary">搜索</el-button>
        <el-table
                border
                :data="psearchTable"
                style="width: 60%;margin-top: 20px">
            <el-table-column
                    prop="id"
                    label="编号"
                    align="center"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="name"
                    label="处罚单位"
                    align="center"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="fine_date"
                    label="处罚日期"
                    align="center"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="ref"
                    label="处罚依据"
                    align="center"
                    width="160">
            </el-table-column>
            <el-table-column
                    prop="method"
                    label="处罚措施"
                    align="center">
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        name: "HealthSupPunishSearch",
        data(){
            return{
                findName:'',
                psearchTable: [],
            }
        },
        mounted() {
            this.inittable();
        },
        methods:{
            inittable(){
                this.getRequest('/fine/findall').then(resp=>{
                    if(resp){
                        console.log(resp);
                        this.psearchTable = resp.data.data;
                    }
                })
            },
            getMessageList(){
                this.getRequest('/fine/find/' + this.findName).then(resp=>{
                    if(resp){
                        console.log(resp);
                        this.psearchTable = resp.data.data;
                        if(this.findName==''){
                            this.inittable();
                        }
                    }
                })
            },
        }
    }
</script>

<style scoped>

</style>
